package morningcat.study.disconf;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import lombok.Setter;
import org.springframework.context.annotation.Configuration;

/**
 * XXX
 *
 * @author mengzhang6
 * @date 2018/10/15 9:43
 */
@Configuration
@DisconfFile(filename = "agora.properties")
@Setter
public class AppConfig {
    private String apiKey;

    /**
     * 注意：name 指向 agora.properties 中的key
     * associateField 指向 AppConfig 类中的属性
     *
     * @return
     */
    @DisconfFileItem(name = "config.apiKey", associateField = "apiKey")
    public String getApiKey() {
        return apiKey;
    }

}

